/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tp2pdf.convert.bean;

import java.math.BigDecimal;
import javax.ejb.Stateless;

/**
 *
 * @author Danicela
 */
@Stateless
public class ConverterBean implements Converter {

    private BigDecimal yenRate = new BigDecimal("115.3100");
    private BigDecimal euroRate = new BigDecimal("0.0071");

    @Override
    public BigDecimal dollarToYen(BigDecimal dollars) {
        BigDecimal result = dollars.multiply(yenRate);
        return result.setScale(2, BigDecimal.ROUND_UP);

    }

    @Override
    public BigDecimal yenToEuro(BigDecimal yen) {
        BigDecimal result = yen.multiply(euroRate);
        return result.setScale(2, BigDecimal.ROUND_UP);
    }
}
